<template>
  <div class="containers">
     <div class="container">
       <div class="form-box" style="width: 100%;max-width: 900px;">
         <el-tabs>
           <el-tab-pane label="退货地址" >
             <el-form ref="form" label-width="120px">
               <el-form-item label="联系人">
                 <el-input v-model="name" placeholder="请输入联系人"></el-input>
               </el-form-item>
               <el-form-item label="联系电话">
                 <el-input v-model="mobile" placeholder="请输入联系电话"></el-input>
               </el-form-item>
               <el-form-item label="退货地址">
                 <el-input v-model="address" placeholder="请输入退货地址"></el-input>
               </el-form-item>
             </el-form>
           </el-tab-pane>
         </el-tabs>
        <el-button type="primary" @click="set">确认修改</el-button>
       </div>
     </div>
   </div>
 </template>
 
 <script>
 export default {
     data() {
         return {
          mobile:'',    //联系电话
          name:'',      //联系人
          address:'',   //退货地址
         };
     },
 
     mounted() {
      this.load()
     },
 
     methods: {
         load() {
            this.request('business/refundsAddress/', 'get', {}).then(
              res => {
                console.log(res)
                this.mobile=res.data.mobile
                this.name=res.data.name    //联系人
                this.address=res.data.address
              },
              function () {
              console.log('请求失败处理');
              }
            );
         },
         set() {
            this.request('business/refundsAddress/', 'POST', {mobile:this.mobile,name:this.name,address:this.address}).then(
              res => {
                this.load()
                if (res.errno == 0) {
                this.$message.success(res.errmsg);
                }else{
                  this.$message.error(res.errmsg);
                }
              },
              function () {
              console.log('请求失败处理');
              }
            );
         },
     },
 };
 </script>
 
 <style lang="scss" scoped>
 
 </style>
 